package wineshop.fixture;

import javax.naming.NamingException;

import wineshop.test.CustomerBeanITRemote;

public class IsCustomerValid {
	private CustomerBeanITRemote customerBean;

	private String username;
	private String password;

	public IsCustomerValid() throws NamingException {
		customerBean = (CustomerBeanITRemote) Environment.context
				.lookup("wineshop.test.CustomerBeanITRemote");
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public boolean valid() {
		return customerBean.isValidCustomer(username, password.toCharArray());
	}
}
